(function(){ var d=document; var b=d.querySelector('.ov-hamb'),n=d.getElementById('ov-menu'); if(b&&n){b.addEventListener('click',function(){var o=n.classList.toggle('open');b.setAttribute('aria-expanded',o);b.setAttribute('aria-label',o?'Close menu':'Open menu')})} var els=d.querySelectorAll('.ov-rise,.ov-rings,.ov-score,.ov-fig,.ov-path,.ov-hex,.ov-plate'); function on(e){e.classList.add('is-in')} if('IntersectionObserver' in window){ var io=new IntersectionObserver(function(es){es.forEach(function(x){if(x.isIntersecting){on(x.target);io.unobserve(x.target)}})},{threshold:.12,rootMargin:'0px 0px -30px 0px'}); els.forEach(function(e){io.observe(e)}); }else{els.forEach(on)} var cs=d.querySelectorAll('[data-count]'); function run(el){var t=parseFloat(el.getAttribute('data-count')),dec=(el.getAttribute('data-count').split('.')[1]||'').length,suf=el.getAttribute('data-suf')||'',s=null; function f(ts){if(!s)s=ts;var p=Math.min((ts-s)/1400,1),v=t*(1-Math.pow(1-p,3));el.textContent=v.toFixed(dec).replace(/\B(?=(\d{3})+(?!\d))/g,',')+suf;if(p<1)requestAnimationFrame(f)} requestAnimationFrame(f)} if('IntersectionObserver' in window){var i2=new IntersectionObserver(function(es){es.forEach(function(x){if(x.isIntersecting){run(x.target);i2.unobserve(x.target)}})},{threshold:.5});cs.forEach(function(e){i2.observe(e)})} var dock=d.querySelector('.ov-dock'),hero=d.querySelector('.ov-hero,.ov-page'),end=d.querySelector('.ov-end,.ov-foot'); if(dock){var u=function(){var y=window.scrollY,h=hero?hero.offsetHeight:400,t=end?end.getBoundingClientRect().top:9e9;dock.classList.toggle('on',y>h&&t>window.innerHeight-40)};window.addEventListener('scroll',u,{passive:true});u()} var f=d.querySelector('.ov-find'); if(f){var box=f.closest('.ov-faq'),qs=box.querySelectorAll('.ov-q'); f.addEventListener('input',function(){var v=f.value.trim().toLowerCase(),c=0;qs.forEach(function(q){var m=!v||q.textContent.toLowerCase().indexOf(v)>-1;q.style.display=m?'':'none';if(m)c++;if(v&&m)q.open=true});box.classList.toggle('empty',c===0)})} })();